<template>
  <div>
    <h1>这是输入的文本:{{mercode}}</h1>
    <my-input-2
      inputtype="text"
      textname="文本输入框:"
      placeholder="这是默认文字"
      @update:value="mercode = $event"
    ></my-input-2>

    <my-input-2 inputtype="text" textname="文本输入框:" placeholder="这是默认文字" :value.sync="mercode"></my-input-2>

    <my-input
      inputtype="text"
      textname="文本输入框:"
      placeholder="这是默认文字"
      @inputchanged="inputchangedmer($event)"
    ></my-input>
  </div>
</template>
<script>
import input from "./base2/input.vue";
import input2 from "./base2/input2.vue";
export default {
  name: "emit",
  components: {
    "my-input": input,
    "my-input-2": input2,
  },
  data() {
    return {
      mercode: "",
    };
  },
  methods: {
    //输入框事件监听
    inputchangedmer: function (e) {
      this.mercode = e.target.value;
    },
  },
};
</script>